const urlmovie='https://m.douban.com/rexxar/api/v2/subject_collection/movie_showing/items?count=5'
const urltv='https://m.douban.com/rexxar/api/v2/subject_collection/tv_hot/items?count=5'
const urlzy='https://m.douban.com/rexxar/api/v2/subject_collection/tv_variety_show/items?count=5'
Page({ 
  data:{
    title:''
  },
  input(e){
    //console.log(e)
    this.setData({
      title:e.detail.value
    })
  },
  search(){
    wx.navigateTo({//跳转
      url: 'search?title='+this.data.title,
    })
  },
  onLoad(){
    wx.request({//发起 HTTPS 网络请求。
      url: urlmovie,//url获取开发者服务器 接口地址
      success:res=>{//接口调用成功的回调函数
        console.log(res)
        this.setData({//改变(更新)属性值
          // 更新属性和数据的方法与更新页面数据的方法类似
          movie:res.data.subject_collection_items
        })
      }
    }),
    wx.request({
      url: urltv,
      success:res=>{
        console.log(res)
        this.setData({
          tv:res.data.subject_collection_items
        })
      }
    }),
    wx.request({
      url: urlzy,
      success:res=>{
        console.log(res)
        this.setData({
          zy:res.data.subject_collection_items
        })
      }
    })
  }
})